//
//  Call.m
//  jmGouTong
//
//  Created by 王大虎 on 2022/9/22.
//  Copyright © 2022 seclery. All rights reserved.
//

#import "Call.h"

@implementation Call

- (void)setState:(CallState)state{
    _state = state;
    [self stateChanged];
}


- (void)setConnectedState:(ConnectedState)connectedState{
    _connectedState = connectedState;
    [self connectedStateChanged];
}

- (instancetype)initWithUUID:(NSUUID*)uuid isOutgoing:(BOOL)outgoing handle:(NSString *)handle isAudioCall:(BOOL)isAudioCall{
    self = [super init];
    if (self) {
        _uuid = uuid;
        _outgoing = outgoing;
        _handle = handle;
        _isAudioCall = isAudioCall;
    }
    return self;
}

-(void)start:(success)completion{
    completion(YES);
    
    self.state = active;
    self.connectedState = complete;
}

-(void)answer{
    self.state = active;
}

-(void)end{
    self.state = ended;
}



@end
